package com.yym.project.service.impl;

import com.yym.project.dao.IBookDao;
import com.yym.project.dao.impl.IBookDaoImpl;
import com.yym.project.entity.Book;
import com.yym.project.service.IBookService;
import com.yym.project.utils.Dbutil;
import com.yym.project.utils.RowMapper;

import java.sql.Connection;
import java.sql.ResultSet;
import java.util.List;

public class IBookServiceImpl implements IBookService {
    private IBookDao bookDao = new IBookDaoImpl();

    @Override
    public int save(Book book) throws Exception {
        return bookDao.save(book);
    }

    @Override
    public int update(Book book) throws Exception {
        return bookDao.update(book);
    }

    @Override
    public int delete(int id) throws Exception {
       return  bookDao.delete(id);
    }

    @Override
    public Book selectByName(String name) throws Exception {
      return bookDao.selectByName(name);

    }

    @Override
    public List<Book> list() throws Exception {
        return bookDao.list();
    }
}
